package controller;

import entity.Topic;
import service.ITopicService;
import service.impl.TopicService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class UpdateEdServlet extends HttpServlet {


    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Integer fid= Integer.valueOf(request.getParameter("mid"));
        ITopicService itd=new TopicService();
        Topic t=itd.getUid(fid);
         request.getSession().setAttribute("t",t);
         request.getRequestDispatcher("boards/edit.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      doGet(req, resp);
    }
}
